import { CopyControllerBase } from "./CopyControllerBase";
import { ECopyType } from "../../../../../Message/Public/ECopyType";
import { PulseSharedObject } from "../../player/PulseSharedObject";
import { TodayNoTipsConst } from "../../../../component/gconst/TodayNoTipsConst";
import { CopyConfig } from "../../../resource/CopyConfig";
import { DataEvent } from "../../../events/DataEvent";
import { SEntityInfo } from "../../../../../Message/BroadCast/SEntityInfo";
import { ThingUtil } from "../../../scene/layer/utils/ThingUtil";
import { UserPlayer } from "../../../scene/player/entity/UserPlayer";
import { StaticResUrl } from "../../../resource/StaticResUrl";
import { RolePlayer } from "../../../scene/player/entity/RolePlayer";
import { GuildRobCityCopyOneInfoPanel } from "../guildRobCityCopy/copyOne/GuildRobCityCopyOneInfoPanel";
import { NetDispatcher } from "../../../../mvc/core/NetDispatcher";
import { EPublicCommand } from "../../../../../Message/Command/EPublicCommand";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { EventName } from "../../../mvc/EventName";
import { TCopy } from "../../../../../Message/Db/Tables/TCopy";
import { PlayerEvent } from "../../../scene/events/PlayerEvent";
import { GuildRobCityCopyIcon } from "../guildRobCityCopy/GuildRobCityCopyIcon";
import { RobCityCopyRule } from "../guildRobCityCopy/RobCityCopyRule";
import { GuildRobCityCopyTwoInfoPanel } from "../guildRobCityCopy/copyTwo/GuildRobCityCopyTwoInfoPanel";
import { GuildRobCityCopyThreeInfoPanel } from "../guildRobCityCopy/copyThree/GuildRobCityCopyThreeInfoPanel";
import { GuildRobCityCopyTwoRankPanel } from "../guildRobCityCopy/copyTwo/GuildRobCityCopyTwoRankPanel";
import { GuildRobCityCopyThreeRankPanel } from "../guildRobCityCopy/copyThree/GuildRobCityCopyThreeRankPanel";
import { MessageBlock } from "../../../../../Framework/MQ/MessageBlock";
import { SGuildRobCityOneInfo } from "../../../../../Message/Public/SGuildRobCityOneInfo";
import { SGuildRobCityOneCopyInfo } from "../../../../../Message/Public/SGuildRobCityOneCopyInfo";
import { SRobCityTwoJoinTeamInfo } from "../../../../../Message/Public/SRobCityTwoJoinTeamInfo";
import { MsgManager } from "../../../manager/MsgManager";
import { Language } from "../../../../../extend/language/Language";
import { SRobCityThreeJoinTeamInfo } from "../../../../../Message/Public/SRobCityThreeJoinTeamInfo";
import { SRobCityThreeCopyInfo } from "../../../../../Message/Public/SRobCityThreeCopyInfo";
import { SRobCityTwoRanks } from "../../../../../Message/Public/SRobCityTwoRanks";
import { DataProvider } from "../../../../../fl/data/DataProvider";
import { GRCTwoRankData } from "../guildRobCityCopy/copyTwo/GRCTwoRankData";
import { SRobCityThreeRanks } from "../../../../../Message/Public/SRobCityThreeRanks";
import { GRCThreeRankData } from "../guildRobCityCopy/copyThree/GRCThreeRankData";
import { SRobCityEndReward } from "../../../../../Message/Public/SRobCityEndReward";
import { RemainTimeTool } from "../../award/RemainTimeTool";
import { Alert } from "../../../../../com/mui/controls/Alert";
import { GuildRobCityCopyTwoResult } from "../guildRobCityCopy/copyTwo/GuildRobCityCopyTwoResult";
import { GuildRobCityCopyThreeResult } from "../guildRobCityCopy/copyThree/GuildRobCityCopyThreeResult";
type int = number;
//class GuildRobCityCopyController
    
    export  class GuildRobCityCopyController extends CopyControllerBase
    {
        constructor()
        {
            super();
            return;
        }

        /* internal  */showCopyRulePanel(arg1: int): void
        {
            var loc1=arg1;
            switch (loc1) 
            {
                case ECopyType._ECopyRobCityOne:
                {
                    if (!PulseSharedObject.getValue(TodayNoTipsConst.RobCityCopyOneTip)) 
                    {
                        this.copyRulePanel.copyType = arg1;
                        this.copyRulePanel.ruleText = CopyConfig.instance.getRobCopyDesc(7);
                        this.copyRulePanel.show();
                    }
                    break;
                }
                case ECopyType._ECopyRobCityTwo:
                {
                    if (!PulseSharedObject.getValue(TodayNoTipsConst.RobCityCopyTwoTip)) 
                    {
                        this.copyRulePanel.copyType = arg1;
                        this.copyRulePanel.ruleText = CopyConfig.instance.getRobCopyDesc(8);
                        this.copyRulePanel.show();
                    }
                    break;
                }
                case ECopyType._ECopyRobCityThree:
                {
                    if (!PulseSharedObject.getValue(TodayNoTipsConst.RobCityCopyThreeTip)) 
                    {
                        this.copyRulePanel.copyType = arg1;
                        this.copyRulePanel.ruleText = CopyConfig.instance.getRobCopyDesc(9);
                        this.copyRulePanel.show();
                    }
                    break;
                }
            }
            return;
        }

        /* internal  */onSceneAddEntityHandler(arg1: DataEvent): void
        {
            var loc1=null;
            var loc2=0;
            var loc3=null;
            if (typeof arg1.data === "sentityinfo") 
            {
                loc1 = arg1.data as SEntityInfo;
                loc2 = this.getDefenceForce();
                if (loc1.force == loc2) 
                {
                    if (loc3 = ThingUtil.entityUtil.getEntity(loc1.entityId) as UserPlayer) 
                    {
                        loc3.updateTitleEx(StaticResUrl.RobCityDefenceTitle, true);
                    }
                }
            }
            return;
        }

        /* internal  */onRoleRelived(arg1): void
        {
            var loc1=RolePlayer.instance.entityInfo.entityInfo;
            var loc2=this.getDefenceForce();
            if (loc1.force != loc2) 
            {
                RolePlayer.instance.updateTitleEx(StaticResUrl.RobCityDefenceTitle, false);
            }
            else 
            {
                RolePlayer.instance.updateTitleEx(StaticResUrl.RobCityDefenceTitle, true);
            }
            return;
        }

        /* internal  */updateDefenceTitle(): void
        {
            var loc2=null;
            var loc3=false;
            var loc4=null;
            var loc5=0;
            var loc1=this.getDefenceForce();
            if (loc1 != -1) 
            {
                loc2 = ThingUtil.entityUtil.getAllUserList();
                loc5 = 0;
                while (loc5 < loc2.length) 
                {
                    if (loc4 = loc2[loc5] as UserPlayer) 
                    {
                        loc3 = false;
                        if (loc4.entityInfo.entityInfo.force == loc1) 
                        {
                            loc3 = true;
                        }
                        loc4.updateTitleEx(StaticResUrl.RobCityDefenceTitle, loc3);
                    }
                    ++loc5;
                }
            }
            return;
        }

        /* internal  */getDefenceForce(): int
        {
            var loc2=null;
            var loc1=cache.robCity.robCityCopyThreeCopyInfo;
            if (loc1) 
            {
                var loc3=0;
                var loc4=loc1.robCityThreeJoinTeams;
                for(loc2 of loc4) 
                {
                    if (!(loc2.shaBak > 0)) 
                    {
                        continue;
                    }
                    return loc2.froce;
                }
            }
            return -1;
        }

        public get copyOneInfoPanel(): GuildRobCityCopyOneInfoPanel
        {
            if (!this._copyOneInfoPanel) 
            {
                this._copyOneInfoPanel = new GuildRobCityCopyOneInfoPanel();
            }
            return this._copyOneInfoPanel;
        }

        /* internal  */removeDefenceTitle(): void
        {
            var loc2=null;
            var loc1=ThingUtil.entityUtil.getAllUserList();
            var loc3=0;
            while (loc3 < loc1.length) 
            {
                loc2 = loc1[loc3] as UserPlayer;
                if (loc2) 
                {
                    loc2.updateTitleEx(StaticResUrl.RobCityDefenceTitle, false);
                }
                ++loc3;
            }
            return;
        }

        protected /* override */ initServer(): void
        {
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicRobCityEndReward, this.onReceiveCopyEndRewardCommand);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicGuildRobCityOneInfo, this.onReceiveCopyOneInfo);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicGuildRobCityOneCopyInfo, this.onReceiveCopyOneCopyInfo);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicRobCityTwoForce, this.onReceiveCopyTwoForceInfo);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicRobCityTwoScore, this.onReceiveCopyTwoScoreInfo);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicRobCityTwoStart, this.onRobCityTwoStartHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicRobCityTwoRank, this.onReceiveCopyTwoRank);
            Dispatcher.addEventListener(EventName.RobCity_ShowCopyTwoRankPanel, this.onShowCopyTwoRankPanel);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicRobCityThreeForce, this.onReceiveCopyThreeForceInfo);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicRobCityThreeCopyInfo, this.onReceiveCopyThreeCopyInfo);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicRobCityThreeStart, this.onRobCityThreeStartHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicRobCityThreeRank, this.onReceiveCopyThreeRank);
            Dispatcher.addEventListener(EventName.RobCity_ShowCopyThreeRankPanel, this.onShowCopyThreeRankPanel);
            return;
        }

        public /* override */ enterCopy(arg1: TCopy): void
        {
            super.enterCopy(arg1);
            var loc1=arg1.copyType;
            switch (loc1) 
            {
                case ECopyType._ECopyRobCityOne:
                {
                    this.copyOneInfoPanel.show();
                    this.copyOneInfoPanel.updatePosition();
                    this.copyOneInfoPanel.showPanel();
                    this.copyOneInfoPanel.title = arg1.name;
                    this.copyOneInfoPanel.updateInfos(cache.robCity.robCityCopyOneCopyInfo);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildHideOpenCopyWindow));
                    this.showCopyRulePanel(arg1.copyType);
                    break;
                }
                case ECopyType._ECopyRobCityTwo:
                {
                    this.copyTwoInfoPanel.show();
                    this.copyTwoInfoPanel.updatePosition();
                    this.copyTwoInfoPanel.showPanel();
                    this.copyTwoInfoPanel.title = arg1.name;
                    this.copyTwoInfoPanel.updateInfos(cache.robCity.robCityCopyTwoInfo);
                    this.copyTwoInfoPanel.updateLeftTime(cache.robCity.robCityCopyTwoStartInfo, cache.robCity.robCityCopyTwoStarted);
                    this.showCopyRulePanel(arg1.copyType);
                    break;
                }
                case ECopyType._ECopyRobCityThree:
                {
                    this.copyThreeInfoPanel.show();
                    this.copyThreeInfoPanel.updatePosition();
                    this.copyThreeInfoPanel.showPanel();
                    this.copyThreeInfoPanel.title = arg1.name;
                    this.copyThreeInfoPanel.updateInfos(cache.robCity.robCityCopyThreeCopyInfo);
                    this.copyThreeInfoPanel.updateLeftTime(cache.robCity.robCityCopyThreeStartInfo, cache.robCity.robCityCopyThreeStarted);
                    this.showCopyRulePanel(arg1.copyType);
                    this.updateDefenceTitle();
                    ThingUtil.entityUtil.showUserGuildName(true);
                    Dispatcher.addEventListener(EventName.Scene_AddEntity, this.onSceneAddEntityHandler);
                    RolePlayer.instance.addEventListener(PlayerEvent.ENTITY_Relived, this.onRoleRelived);
                    break;
                }
            }
            Dispatcher.dispatchEvent(new DataEvent(EventName.RobCity_CloseRobCityModule));
            return;
        }

        public get hintIcon(): GuildRobCityCopyIcon
        {
            if (this._hintIcon == null) 
            {
                this._hintIcon = new GuildRobCityCopyIcon();
            }
            return this._hintIcon;
        }

        public get copyRulePanel(): RobCityCopyRule
        {
            if (this._copyRulePanel == null) 
            {
                this._copyRulePanel = new RobCityCopyRule();
            }
            return this._copyRulePanel;
        }

        public /* override */ leaveCopy(): void
        {
            if (copy && copy.copyType == ECopyType._ECopyRobCityThree) 
            {
                this.removeDefenceTitle();
                Dispatcher.removeEventListener(EventName.Scene_AddEntity, this.onSceneAddEntityHandler);
                RolePlayer.instance.removeEventListener(PlayerEvent.ENTITY_Relived, this.onRoleRelived);
            }
            if (this._copyOneInfoPanel) 
            {
                this._copyOneInfoPanel.hide();
                this._copyOneInfoPanel.clean();
                this._copyOneInfoPanel = null;
            }
            if (this._copyTwoInfoPanel) 
            {
                this._copyTwoInfoPanel.hide();
                this._copyTwoInfoPanel.clean();
                this._copyTwoInfoPanel = null;
            }
            if (this._copyThreeInfoPanel) 
            {
                this._copyThreeInfoPanel.hide();
                this._copyThreeInfoPanel.clean();
                this._copyThreeInfoPanel = null;
            }
            if (this._copyTwoRankPanel) 
            {
                this._copyTwoRankPanel.hide();
                this._copyTwoRankPanel.dispose();
                this._copyTwoRankPanel = null;
            }
            if (this._copyThreeRankPanel) 
            {
                this._copyThreeRankPanel.hide();
                this._copyThreeRankPanel.dispose();
                this._copyThreeRankPanel = null;
            }
            super.leaveCopy();
            return;
        }

        public get copyTwoInfoPanel(): GuildRobCityCopyTwoInfoPanel
        {
            if (!this._copyTwoInfoPanel) 
            {
                this._copyTwoInfoPanel = new GuildRobCityCopyTwoInfoPanel();
            }
            return this._copyTwoInfoPanel;
        }

        public get copyThreeInfoPanel(): GuildRobCityCopyThreeInfoPanel
        {
            if (!this._copyThreeInfoPanel) 
            {
                this._copyThreeInfoPanel = new GuildRobCityCopyThreeInfoPanel();
            }
            return this._copyThreeInfoPanel;
        }

        public get copyTwoRankPanel(): GuildRobCityCopyTwoRankPanel
        {
            if (!this._copyTwoRankPanel) 
            {
                this._copyTwoRankPanel = new GuildRobCityCopyTwoRankPanel();
            }
            return this._copyTwoRankPanel;
        }

        public get copyThreeRankPanel(): GuildRobCityCopyThreeRankPanel
        {
            if (!this._copyThreeRankPanel) 
            {
                this._copyThreeRankPanel = new GuildRobCityCopyThreeRankPanel();
            }
            return this._copyThreeRankPanel;
        }

        /* internal  */hideHintIcoon(): void
        {
            if (this._hintIcon) 
            {
                this._hintIcon.hide();
            }
            return;
        }

        /* internal  */onReceiveCopyOneInfo(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SGuildRobCityOneInfo;
            cache.robCity.robCityCopyOneInfo = loc1;
            if (!cache.copy.isInCopyType(ECopyType._ECopyRobCityOne)) 
            {
                if (loc1 && loc1.hasOpen) 
                {
                    this.hintIcon.copyType = ECopyType._ECopyRobCityOne;
                    this.hintIcon.show();
                    Dispatcher.dispatchEvent(new DataEvent(EventName.RobCity_OpenRobCityModule, 1));
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildUnionUpdateChatChanel));
                }
            }
            if (loc1 && loc1.weekCount > 0 && !loc1.hasOpen) 
            {
                this.hideHintIcoon();
                Dispatcher.dispatchEvent(new DataEvent(EventName.GuildUnionUpdateChatChanel));
            }
            Dispatcher.dispatchEvent(new DataEvent(EventName.CopyUpdateGuildCopyEntranceStatus));
            return;
        }

        /* internal  */onReceiveCopyOneCopyInfo(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SGuildRobCityOneCopyInfo;
            cache.robCity.robCityCopyOneCopyInfo = loc1;
            if (cache.copy.isInCopyType(ECopyType._ECopyRobCityOne)) 
            {
                if (this._copyOneInfoPanel) 
                {
                    this._copyOneInfoPanel.updateInfos(loc1);
                }
            }
            return;
        }

        /* internal  */onReceiveCopyTwoForceInfo(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SRobCityTwoJoinTeamInfo;
            cache.robCity.robCityCopyTwoInfo = loc1;
            return;
        }

        /* internal  */onReceiveCopyTwoScoreInfo(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SRobCityTwoJoinTeamInfo;
            cache.robCity.robCityCopyTwoInfo = loc1;
            if (cache.copy.isInCopyType(ECopyType._ECopyRobCityTwo)) 
            {
                if (this._copyTwoInfoPanel) 
                {
                    this._copyTwoInfoPanel.updateInfos(loc1);
                }
            }
            return;
        }

        /* internal  */onRobCityTwoStartHandler(arg1: MessageBlock): void
        {
            if (cache.copy.isInCopyType(ECopyType._ECopyRobCityTwo)) 
            {
                ThingUtil.isEntitySort = true;
                if (this._copyTwoInfoPanel) 
                {
                    this._copyTwoInfoPanel.updateLeftTime(cache.robCity.robCityCopyTwoStartInfo, true);
                    MsgManager.showTaskTarget(Language.getStringByParam(60972, cache.copy.copyInfo.name));
                }
            }
            return;
        }

        /* internal  */onReceiveCopyThreeForceInfo(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SRobCityThreeJoinTeamInfo;
            cache.robCity.robCityCopyThreeInfo = loc1;
            return;
        }

        /* internal  */onReceiveCopyThreeCopyInfo(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SRobCityThreeCopyInfo;
            cache.robCity.robCityCopyThreeCopyInfo = loc1;
            if (cache.copy.isInCopyType(ECopyType._ECopyRobCityThree)) 
            {
                if (this._copyThreeInfoPanel) 
                {
                    this._copyThreeInfoPanel.updateInfos(loc1);
                }
                this.updateDefenceTitle();
            }
            return;
        }

        /* internal  */onRobCityThreeStartHandler(arg1: MessageBlock): void
        {
            if (cache.copy.isInCopyType(ECopyType._ECopyRobCityThree)) 
            {
                ThingUtil.isEntitySort = true;
                this.updateDefenceTitle();
                if (this._copyThreeInfoPanel) 
                {
                    this._copyThreeInfoPanel.updateLeftTime(cache.robCity.robCityCopyThreeStartInfo, true);
                    MsgManager.showTaskTarget(Language.getStringByParam(60972, cache.copy.copyInfo.name));
                }
            }
            return;
        }

        /* internal  */onShowCopyThreeRankPanel(arg1: DataEvent): void
        {
            if (cache.copy.isInCopyType(ECopyType._ECopyRobCityThree)) 
            {
                this.copyThreeRankPanel.show();
                this.copyThreeRankPanel.showRank(0);
            }
            return;
        }

        /* internal  */onShowCopyTwoRankPanel(arg1: DataEvent): void
        {
            if (cache.copy.isInCopyType(ECopyType._ECopyRobCityTwo)) 
            {
                this.copyTwoRankPanel.show();
                this.copyTwoRankPanel.showRank(0);
            }
            return;
        }

        /* internal  */onReceiveCopyTwoRank(arg1: MessageBlock): void
        {
            var loc1=null;
            if (cache.copy.isInCopyType(ECopyType._ECopyRobCityTwo)) 
            {
                if (this._copyTwoRankPanel && !this._copyTwoRankPanel.isHide) 
                {
                    loc1 = arg1.messageBase as SRobCityTwoRanks;
                    if (loc1.type == 1) 
                    {
                        this._copyTwoRankPanel.updateRankData(0, this.getCopyTwoKillRankingData(loc1), loc1.targetPage, loc1.totalPage);
                    }
                }
            }
            return;
        }

        /* internal  */getCopyTwoKillRankingData(arg1: SRobCityTwoRanks): DataProvider
        {
            var loc1=0;
            var loc2=null;
            if (this._copyTwoKillRankingDp) 
            {
                this._copyTwoKillRankingDp.removeAll();
            }
            else 
            {
                this._copyTwoKillRankingDp = new DataProvider();
            }
            loc1 = 0;
            while (loc1 < arg1.robCityTwoPlayers.length) 
            {
                loc2 = new GRCTwoRankData(arg1.robCityTwoPlayers[loc1]);
                loc2.rank = (arg1.targetPage - 1) * 10 + (loc1 + 1);
                loc2.guildName = cache.robCity.getRobCityTwoGuildName(loc2.force);
                this._copyTwoKillRankingDp.addItem(loc2);
                ++loc1;
            }
            return this._copyTwoKillRankingDp;
        }

        /* internal  */onReceiveCopyThreeRank(arg1: MessageBlock): void
        {
            var loc1=null;
            if (cache.copy.isInCopyType(ECopyType._ECopyRobCityThree)) 
            {
                if (this._copyThreeRankPanel && !this._copyThreeRankPanel.isHide) 
                {
                    loc1 = arg1.messageBase as SRobCityThreeRanks;
                    if (loc1.type != 1) 
                    {
                        if (loc1.type == 2) 
                        {
                            this._copyThreeRankPanel.updateRankData(1, this.getKillRankingData(loc1), loc1.targetPage, loc1.totalPage);
                        }
                    }
                    else 
                    {
                        this._copyThreeRankPanel.updateRankData(0, this.getHurtRankingData(loc1), loc1.targetPage, loc1.totalPage);
                    }
                }
            }
            return;
        }

        /* internal  */getHurtRankingData(arg1: SRobCityThreeRanks): DataProvider
        {
            var loc1=0;
            var loc2=null;
            if (this._hurtRankingDp) 
            {
                this._hurtRankingDp.removeAll();
            }
            else 
            {
                this._hurtRankingDp = new DataProvider();
            }
            this.ttt(arg1);
            loc1 = 0;
            while (loc1 < arg1.robCityThreePlayers.length) 
            {
                loc2 = new GRCThreeRankData(arg1.robCityThreePlayers[loc1]);
                loc2.rank = (arg1.targetPage - 1) * 10 + (loc1 + 1);
                loc2.guildName = cache.robCity.getRobCityThreeGuildName(loc2.force);
                this._hurtRankingDp.addItem(loc2);
                ++loc1;
            }
            return this._hurtRankingDp;
        }

        /* internal  */getKillRankingData(arg1: SRobCityThreeRanks): DataProvider
        {
            var loc1=0;
            var loc2=null;
            if (this._killRankingDp) 
            {
                this._killRankingDp.removeAll();
            }
            else 
            {
                this._killRankingDp = new DataProvider();
            }
            this.ttt(arg1);
            loc1 = 0;
            while (loc1 < arg1.robCityThreePlayers.length) 
            {
                loc2 = new GRCThreeRankData(arg1.robCityThreePlayers[loc1]);
                loc2.rank = (arg1.targetPage - 1) * 10 + (loc1 + 1);
                loc2.guildName = cache.robCity.getRobCityThreeGuildName(loc2.force);
                loc2.camp = cache.robCity.getRobCityThreeCamp(loc2.force);
                this._killRankingDp.addItem(loc2);
                ++loc1;
            }
            return this._killRankingDp;
        }

        /* internal  */ttt(arg1: SRobCityThreeRanks): void
        {
            var loc1=0;
            var loc2=null;
            return;
            return;
        }

        /* internal  */onReceiveCopyEndRewardCommand(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SRobCityEndReward;
            if (cache.copy.isInCopyType(loc1.copyType)) 
            {
                var loc2=loc1.copyType;
                switch (loc2) 
                {
                    case ECopyType._ECopyRobCityOne:
                    {
                        this.showRobCityOneResultHandler(loc1);
                        break;
                    }
                    case ECopyType._ECopyRobCityTwo:
                    {
                        this.showRobCityTwoResultHandler(loc1);
                        if (this._copyTwoInfoPanel) 
                        {
                            this._copyTwoInfoPanel.stopCountDown();
                        }
                        break;
                    }
                    case ECopyType._ECopyRobCityThree:
                    {
                        this.showRobCityThreeResultHandler(loc1);
                        if (this._copyThreeInfoPanel) 
                        {
                            this._copyThreeInfoPanel.stopCountDown();
                        }
                        break;
                    }
                }
            }
            return;
        }

        /* internal  */showRobCityOneResultHandler(arg1: SRobCityEndReward): void
        {
            var loc2=null;
            var loc1=cache.robCity.robCityCopyOneCopyInfo;
            if (loc1) 
            {
                loc2 = Language.getStringByParam(60947, arg1.experience, arg1.contribution, RemainTimeTool.getRemainTimeBySeconds(loc1.millSeconds / 1000));
                Alert.buttonWidth = 60;
                Alert.show(loc2, null, Alert.OK, null, this.onRobCityOneResultAlertHandler);
            }
            return;
        }

        /* internal  */onRobCityOneResultAlertHandler(arg1: int): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.CopyLeaveWithoutComfirm));
            return;
        }

        /* internal  */showRobCityTwoResultHandler(arg1: SRobCityEndReward): void
        {
            if (cache.robCity.robCityCopyTwoInfo) 
            {
                if (!this._copyTwoResultRanking) 
                {
                    this._copyTwoResultRanking = new GuildRobCityCopyTwoResult();
                }
                this._copyTwoResultRanking.setRankingData(cache.robCity.robCityCopyTwoInfo);
                this._copyTwoResultRanking.show();
            }
            return;
        }

        /* internal  */showRobCityThreeResultHandler(arg1: SRobCityEndReward): void
        {
            if (cache.robCity.robCityCopyThreeCopyInfo) 
            {
                if (!this._copyThreeResultPanel) 
                {
                    this._copyThreeResultPanel = new GuildRobCityCopyThreeResult();
                }
                this._copyThreeResultPanel.updateInfos(arg1, cache.robCity.robCityCopyThreeCopyInfo);
                this._copyThreeResultPanel.show();
            }
            return;
        }

        /* internal */ /* var */_hintIcon: GuildRobCityCopyIcon;

        /* internal */ /* var */_copyRulePanel: RobCityCopyRule;

        /* internal */ /* var */_copyOneInfoPanel: GuildRobCityCopyOneInfoPanel;

        /* internal */ /* var */_copyTwoInfoPanel: GuildRobCityCopyTwoInfoPanel;

        /* internal */ /* var */_copyTwoResultRanking: GuildRobCityCopyTwoResult;

        /* internal */ /* var */_copyThreeInfoPanel: GuildRobCityCopyThreeInfoPanel;

        /* internal */ /* var */_copyThreeResultPanel: GuildRobCityCopyThreeResult;

        /* internal */ /* var */_copyThreeRankPanel: GuildRobCityCopyThreeRankPanel;

        /* internal */ /* var */_copyTwoRankPanel: GuildRobCityCopyTwoRankPanel;

        /* internal */ /* var */_copyTwoKillRankingDp: DataProvider;

        /* internal */ /* var */_killRankingDp: DataProvider;

        /* internal */ /* var */_hurtRankingDp: DataProvider;
    }
